load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "validate",
    srcs = [
        "schema_changer_state.go",
        "validate.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/internal/validate",
    visibility = ["//pkg/sql/catalog:__subpackages__"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/server/telemetry",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/schemachanger/scpb",
        "//pkg/sql/schemachanger/screl",
        "//pkg/util/intsets",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "validate_test",
    srcs = [
        "helpers_test.go",
        "schema_changer_state_test.go",
    ],
    embed = [":validate"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/dbdesc",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/schemadesc",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/schemachanger/scpb",
        "@com_github_stretchr_testify//require",
    ],
)
